<?php
/**
 * Created by PhpStorm.
 * User: liuxiaojie
 * Date: 2019-03-25
 * Time: 21:14
 */

namespace app\recharge\controller;

use app\tools\Wxpay;

class Wxnotify
{

    function notify()
    {

        $content = file_get_contents("php://input");

        $param = (array)simplexml_load_string($content, 'SimpleXMLElement', LIBXML_NOCDATA);

        $wx = new Wxpay();

        $sign = $param['sign'];
        unset($param['sign']);

        $wx->notify($param, $sign);

    }

    function notify2()
    {

        $content = file_get_contents("php://input");

        $param = (array)simplexml_load_string($content, 'SimpleXMLElement', LIBXML_NOCDATA);

        $wx = new Wxpay();

        $sign = $param['sign'];
        unset($param['sign']);

        $wx->notify2($param, $sign);

    }

    function notify3()
    {

        $content = file_get_contents("php://input");
        file_put_contents('l.txt', $content);

        $param = (array)simplexml_load_string($content, 'SimpleXMLElement', LIBXML_NOCDATA);

        $wx = new Wxpay();

        $sign = $param['sign'];
        unset($param['sign']);

        $wx->notify3($param, $sign);

    }

}